//============================================================================
// Name        : lab1_1.cpp
// Author      : Binda&Aeolus
// Version     :
// Copyright   : Copyright © 2011 Binda&Aeolus; All Rights Reserved
// Description : Hello World in C++, Ansi-style
//============================================================================


#include <iostream>
#include "QuickSort.cpp"
#include "FileProcessor.cpp"
using namespace std;

int main() {


	try {
		const string infile_name = "input.txt";//数据来源文件
		const string outfile_name = "output.txt";//数据输出
		const string outfile="output_Desc.txt";
		vector<int> data;
		FileProcessor fp;
      /*
       * 升序排列
       */
		fp.open_file(infile_name);
		fp.getdata(infile_name, data);
		QuickSort qs;
		qs.Sort_Ascend(data, 0, data.size() - 1);
		fp.output_data(outfile_name, data);

		/**
		 * 降序排列
		 */
		FileProcessor fp1;
		fp1.open_file(infile_name);
		fp1.getdata(infile_name, data);
		qs.Sort_Descend(data,0,data.size()-1);
		fp1.output_data(outfile, data);
	} catch (...) {
		throw;
	}

	return 0;
}

